﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Diagnostics;
using Microsoft.Win32;
using Barbar.UrlGuard.BL;

namespace Barbar.UrlGuard {
  public partial class FormError : Form {
    public FormError(Exception exception) {
      if (exception == null)
        throw new ArgumentNullException("exception");

      InitializeComponent();
      txtError.Text = exception.ToString();
    }

    private void btnClose_Click(object sender, EventArgs e) {
      Close();
    }

    private void linkReport_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) {
      IBrowserProvider browserProvider = ServiceLocator.Instance.Resolve<IBrowserProvider>();
      browserProvider.OpenUrl(linkReport.Text);
    }
  }
}
